import { createRouter, createWebHashHistory } from "vue-router";

const routes = [
  {
    path: "/login",
    name: "login",
    component: () => import(/* webpackChunkName: "about" */ "../views/login"),
  },
  {
    path: "/",
    name: "home",
    redirect: "/api/user/list",
    component: () =>
      import(/* webpackChunkName: "about" */ "@/layout/index.vue"),
    children: [
      {
        path: "/api/user/list",
        name: "userList",
        component: () => import("@/views/user/UserList.vue"),
      },
      {
        path: "/api/role/list",
        name: "roleList",
        component: () => import("@/views/role/RoleList.vue"),
      },
      {
        path: "/api/menu/list",
        name: "menuList",
        component: () => import("@/views/menu/MenuList.vue"),
      },
      {
        path: "/api/condition/list",
        name: "conditionList",
        component: () => import("@/views/marketing/ConditionIndex.vue"),
      },
      {
        path: "/api/event/list",
        name: "eventList",
        component: () => import("@/views/marketing/EventIndex.vue"),
      },
      {
        path: "/api/interactive/list",
        name: "interactiveList",
        component: () => import("@/views/marketing/InteractiveIndex.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
